package pl.edu.agh.jemo.evolution.operator.crossover;

import javax.swing.JPanel;

import pl.edu.agh.jemo.evolution.population.Population;

/**
 * Common interface for all crossover operators. 
 * Every class implementing this interface should determine, how population is recombinated.
 * This base crossover or it's subclass type should be used to store crossover objects in every algorithm. 
 * 
 * @author Marcin Zbijowski
 *
 */
public interface Crossover {
	
	/**
	 * Modifies specimen in population following general crossover assumptions.
	 * Opeartor should choose some number of pairs of specimen and try to generate new specimen, based on parent genotypes.
	 * General principle is, that new specimen must be somehow derived from parents, however details of operator behaviour might differ.
	 * 
	 * @param population Population to be modified using this operator.
	 */
	public void performCrossover(Population population);
	
	/**
	 * Returns configuration panel being extension of JPanel instance.
	 * Returned panel is displayed by graphical user interface allowing user to confgiure crossover.
	 * This method may return null if no configuration for operator is possible.
	 * 
	 * @return Instance of JPanel with initialized components prepared to configure objects properties.
	 */
	public JPanel getConfigPanel();
}
